﻿using CleanArchitecture.Core.SharedKernel;
using System;

namespace CleanArchitecture.Infrastructure.Entities.System.DataDic
{
    /// <summary>
    /// Represents a SystemDataDic for Module Button
    /// </summary>
    public partial class SystemDataDicButton : BaseEntity
    {
        #region Field
        private string _displayName;
        private string _btnclass;
        #endregion Field

        #region Ctor
        /// <summary>
        /// Ctor
        /// </summary>
        public SystemDataDicButton()
        {
        }
        #endregion

        #region Property
        /// <summary>
        /// 数据字典树外键ID
        /// </summary>
        public int FKSystemDataDicTreeId { get; set; }

        /// <summary>
        /// 系统预设按钮通过权限分配给系统模块：
        /// </summary>
        public EntityEnumConfig.SystemModuleButtonType ButtonType { get; set; }

        /// <summary>
        /// 数据字典 系统预设按钮名称
        /// </summary>
        public string ButtonName { get; set; }

        public string DisplayName
        {
            get { return string.IsNullOrEmpty(_displayName) ? ButtonName : _displayName; }
            set { _displayName = value; }
        }
        public string ButtonClass
        {
            get { return string.IsNullOrEmpty(_btnclass) || _btnclass.ToLowerInvariant() == "default" ? "layui-btn" : _btnclass; }
            set { _btnclass = value; }
        }
        public string IconCssClass { get; set; }

        public string EventName { get; set; }

        public int DisplayOrder { get; set; }

        public EntityEnumConfig.YesorNo IsActive { get; set; }

        public DateTime CreatedOnTimeUtc { get; set; }

        public virtual SystemDataDicTree BelongTreeNode { get; set; }
        #endregion

    }
}
